<script setup lang='ts'>
import { onBeforeMount, onMounted } from 'vue'
//element-plus lang
import zh from 'element-plus/lib/locale/lang/zh-cn'
import en from 'element-plus/es/locale/lang/en'   
import { storeToRefs } from 'pinia/dist/pinia'
import { useRoute } from 'vue-router'
import { useBasicStore } from '@/store/basic'
import { useConfigStore } from '@/store/config'
//reshow default setting
import { toggleHtmlClass } from '@/theme/utils'
const lang = { zh, en }

const route = useRoute()

const { size, language } = storeToRefs(useConfigStore())
console.log("before onMounted size, language",size.value, language.value);

onMounted(()=>{
    // const { setTheme, theme, setSize, size, setLanguage, language } = useConfigStore()

    //setLanguage(language)
})


</script>
<template>
    <div>
        <el-config-provider :locale="lang[language]" namespace="el" :size="size">
            <router-view/>
        </el-config-provider>
    </div>
</template>
<style lang='scss' scoped>
    
</style>